﻿<!DOCTYPE html>
<html lang="en"  ng-app = "myApp" ng-controller="myCtrl"  ng-init="loaddata()">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<title>About Us</title>
		<meta name="keywords" content="" />
		<meta name="description" content="" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
		<link rel="shortcut icon" type="image/png" href="../../img/favicon.png">
		<!---<link href="https://fonts.googleapis.com/css?family=Open+Sans:300,300i,400,400i,600,600i,700,700i,800,800i" rel="stylesheet">--->
		<link rel="stylesheet" href="../../css/bootstrap.css" type="text/css" />
		<link rel="stylesheet" href="../../css/font-awesome.css" type="text/css" />
		<link rel="stylesheet" href="../../css/style.css" type="text/css" />

		<link rel="stylesheet"  href="../../css/animate.css" type="text/css" />
		<link rel="stylesheet"  href="../../css/pic-select.css" type="text/css" />
		<!--[if IE]>
		<script src="../../js/html5.js"></script>
		<![endif]-->
	</head>
	<body>
		<div id="page-preloader"><span class="spinner"></span></div>
		<header id="header" class="clear">
			<a href="../../" class="logo">狼友文化</a>
			<!--<div class="header-right">-->
				<!--<div class="header-search">-->
					<!--<i class="fa fa-search" aria-hidden="true"></i>-->
				<!--</div>-->
			<!--</div>-->
			<nav class="navbar">
				<div class="navbar-header">
					<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
					<span class="sr-only">Toggle navigation</span>
					<span class="icon-bar"></span>
					<span class="icon-bar"></span>
					<span class="icon-bar"></span>
					</button>
				</div>
				<div id="navbar" class="navbar-collapse collapse">
					<ul class="nav navbar-nav menu">
						<li class="dropdown"><a href="" onclick="javascript:history.go(-1);">上一页</a></li>
						<!--<li><a href="blog.html">Blog</a></li>-->
						<!--<li><a href="gallery.html">Gallery</a></li>-->
						<!--<li><a href="about_us.html">About Us</a></li>-->
						<!--<li><a href="contacts.html">Contacts</a></li>-->
					</ul>
				</div>
			</nav>
		</header>
		<!-- header -->
		<!--<div class="breadcrumbs-wrapper">-->
			<!--<ul class="breadcrumbs">-->
				<!--<li><a href="index.html" class="home"><i class="fa fa-home" aria-hidden="true"></i></a></li>-->
				<!--<li><a>About us</a></li>-->
			<!--</ul>-->
		<!--</div>-->
		<!-- breadcrumbs-wrapper -->
		<!--<section class="content-wrapper">-->
			<!--<div class="container">-->
				<!--<div class="title">-->
					<!--<h1>About us</h1>-->
				<!--</div>-->
				<!--<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed sodales blandit nisi, eu molestie nulla facilisis nec. Nunc vitae lacus vitae enim volutpat suscipit. Vestibulum sed elit dui. Nam eget sodales sapien. In viverra, sapien non accumsan laoreet, felis tellus maximus sapien, ac eleifend diam tellus ut nunc. Duis quis sodales velit, vitae gravida ipsum. Proin ut nisi sagittis, aliquet nulla id, condimentum nulla. Vivamus lacinia nibh ut tempor porttitor. Integer lacinia libero at lacinia dictum. Curabitur sed elit molestie, tincidunt tellus ac, ornare enim.</p>-->
				<!--<p>Praesent dapibus posuere blandit. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Sed varius ante id augue faucibus mollis. Vivamus a pretium purus. Curabitur blandit interdum augue, vitae consequat justo interdum eu. Etiam rhoncus mi quis nunc eleifend, scelerisque sagittis ex tempor. Fusce mauris purus, imperdiet id iaculis viverra, aliquam id ligula. Quisque dapibus ultrices lectus, sed maximus nisi. Nulla eget orci ac massa ultrices volutpat id sed dolor. In eget tincidunt neque, non posuere mi. Duis ullamcorper, turpis non pharetra tempor, leo erat porttitor metus, a fermentum tortor augue id ligula. Nulla at euismod turpis. Nunc vitae turpis lacus. Integer fermentum sapien nibh, eget tincidunt est convallis id. Sed vel pharetra erat. Duis quis purus id sem bibendum commodo.</p>-->
				<!--<div class="clear team-wrap">-->
					<!--<h3>Who We Are</h3>-->
					<!--<div class="row">-->
						<!--<article class="col-md-4 team-item">-->
							<!--<div class="img">-->
								<!--<img src="img/img10.jpg" alt="">-->
							<!--</div>-->
							<!--<div class="team-text">-->
								<!--<h4>Alisa Jobs</h4>-->
								<!--<p>Quisque vulputate facilisis quam, a fringilla purus varius at. Aliquam ut sodales quam, imperdiet condimentum elit. Fusce ac pharetra augue. </p>-->
								<!--<div class="spec">Web-Designer</div>-->
								<!--<ul class="social">-->
									<!--<li><a href="#"><i class="fa fa-facebook" aria-hidden="true"></i></a></li>-->
									<!--<li><a href="#"><i class="fa fa-google-plus" aria-hidden="true"></i></a></li>-->
									<!--<li><a href="#"><i class="fa fa-twitter" aria-hidden="true"></i></a></li>-->
									<!--<li><a href="#"><i class="fa fa-youtube-play" aria-hidden="true"></i></a></li>-->
								<!--</ul>-->
							<!--</div>-->
						<!--</article>-->
						<!--<article class="col-md-4 team-item">-->
							<!--<div class="img">-->
								<!--<img src="img/img9.jpg" alt="">-->
							<!--</div>-->
							<!--<div class="team-text">-->
								<!--<h4>Nathan Lee</h4>-->
								<!--<p>Quisque vulputate facilisis quam, a fringilla purus varius at. Aliquam ut sodales quam, imperdiet condimentum elit. Fusce ac pharetra augue. </p>-->
								<!--<div class="spec">Front-end Developer</div>-->
								<!--<ul class="social">-->
									<!--<li><a href="#"><i class="fa fa-facebook" aria-hidden="true"></i></a></li>-->
									<!--<li><a href="#"><i class="fa fa-google-plus" aria-hidden="true"></i></a></li>-->
									<!--<li><a href="#"><i class="fa fa-twitter" aria-hidden="true"></i></a></li>-->
									<!--<li><a href="#"><i class="fa fa-youtube-play" aria-hidden="true"></i></a></li>-->
								<!--</ul>-->
							<!--</div>-->
						<!--</article>-->
						<!--<article class="col-md-4 team-item">-->
							<!--<div class="img">-->
								<!--<img src="img/img11.jpg" alt="">-->
							<!--</div>-->
							<!--<div class="team-text">-->
								<!--<h4>Jack Maroon</h4>-->
								<!--<p>Quisque vulputate facilisis quam, a fringilla purus varius at. Aliquam ut sodales quam, imperdiet condimentum elit. Fusce ac pharetra augue. </p>-->
								<!--<div class="spec">Back-end Developer</div>-->
								<!--<ul class="social">-->
									<!--<li><a href="#"><i class="fa fa-facebook" aria-hidden="true"></i></a></li>-->
									<!--<li><a href="#"><i class="fa fa-google-plus" aria-hidden="true"></i></a></li>-->
									<!--<li><a href="#"><i class="fa fa-twitter" aria-hidden="true"></i></a></li>-->
									<!--<li><a href="#"><i class="fa fa-youtube-play" aria-hidden="true"></i></a></li>-->
								<!--</ul>-->
							<!--</div>-->
						<!--</article>-->
					<!--</div>-->
				<!--</div>-->
			<!--</div>-->
		<!--</section>-->
		<!-- content-wrapper -->
		<section id="testimonials">
			<h3>{{person.userName}}</h3>
			<div class="container">
				<div class="swiper-container" id="testimonials-carousel">
					<div class="swiper-wrapper">
						<div class="swiper-slide">
							<div class="testimonials-block">
								<div class="img">
									<img  src="../../{{person.userImg}}" alt="">
								</div>
								<!--<p>Aliquam vitae lacinia tortor. Cras consequat erat nunc, a placerat massa rhoncus accumsan. </p>-->
								<!--<h6>- Alisa Jobs</h6>-->
							</div>
						</div>
						<!--<div class="swiper-slide">-->
							<!--<div class="testimonials-block">-->
								<!--<div class="img">-->
									<!--<img src="img/img11.jpg" alt="">-->
								<!--</div>-->
								<!--<p>Aliquam vitae lacinia tortor. Cras consequat erat nunc, a placerat massa rhoncus accumsan. </p>-->
								<!--<h6>- Alisa Jobs</h6>-->
							<!--</div>-->
						<!--</div>-->
						<!--<div class="swiper-slide">-->
							<!--<div class="testimonials-block">-->
								<!--<div class="img">-->
									<!--<img src="img/img9.jpg" alt="">-->
								<!--</div>-->
								<!--<p>Aliquam vitae lacinia tortor. Cras consequat erat nunc, a placerat massa rhoncus accumsan. </p>-->
								<!--<h6>- Alisa Jobs</h6>-->
							<!--</div>-->
						<!--</div>-->
					</div>
					<div class="testimonials-pagination"></div>
				</div>
			</div>
		</section>

		<section id="contact">
			<div class="container scroll-animation" data-animation="fadeInUp" data-animation-delay="0s">
				<div class="contact-form">
					<h6>·修改个人信息</h6>
					<div class="row">
						<div class="col-md-6">
							<div class="input-block name-form">
							<input type="text" ng-model="username"  placeholder="输入新昵称/名字"/>
							</div>
							<!--<div class="input-block phone-form">-->
							<!--<input type="text" placeholder="Phone"/>-->
							<!--</div>-->
							<div class="input-block">
								<form  id="imageForm" method="post" enctype="multipart/form-data" onsubmit="return false;" action="../file/upload">
									<div>
										<div class="_box">点击选择头像</div>
									</div>
									<div class="none">
										<input type="file" name="file"  id="_f" onchange="changepic(this)"/>
										<input type="hidden" ng-model="imgAddr" name="imgAddr" id="imgAddr"/>
									</div>
									<div class="input-block">
										<img id="showimg" src=""/>
									</div>
									<input type="submit" value="保存" ng-click="updateUser()"/>
								</form>
							</div>

						</div>
						<!--<form  id="wordForm" method="post" enctype="multipart/form-data" action="file/wordInfo" onsubmit="return false;">-->
							<!--<div class="col-md-6">-->

								<!--<div class="input-block message-form">-->
									<!--<input type="hidden" name="hasName" id="hasName"/>-->
									<!--<input type="hidden" name="imgAddr" id="imgAddr"/>-->
									<!--<textarea id="msg" ng-model="msg" ng-change="saveTempData()" name = "msg" placeholder="（文件不要超过10M）图片只能且必须一张，文字不可以超过200个字。"></textarea>-->

								<!--</div>-->
							<!--</div>-->
							<!--<input type="submit" value="嗷呜" ng-click="sendToWithName()"/>-->
							<!--&lt;!&ndash;<input type="submit" value="匿名" ng-click="sendTo()"/>&ndash;&gt;-->
						<!--</form>-->
					</div>
				</div>
			</div>
		</section>
		<!-- testimonials -->
		<!--<footer id="footer">-->
			<!--<div class="container">-->
				<!--<div class="row">-->
					<!--<div class="col-md-4">-->
						<!--<a href="index.html" class="logo">Matsumari</a>-->
						<!--<p>Etiam dictum purus et leo laoreet, vel congue diam pulvinar. Suspendisse elementum dictum lacus id ultricies. In hac habitasse platea dictumst</p>-->
						<!--<div class="copy">Copyright &copy; 2017.Company name All rights reserved.<a target="_blank" href="http://sc.chinaz.com/moban/">&#x7F51;&#x9875;&#x6A21;&#x677F;</a></div>-->
					<!--</div>-->
					<!--<div class="col-md-3">-->
						<!--<h6>Latest news</h6>-->
						<!--<div class="news-footer">-->
							<!--<a href="blog_inner.html">Praesent ullamcorper sodales</a>-->
							<!--<div class="date">14.11.2016</div>-->
						<!--</div>-->
						<!--<div class="news-footer">-->
							<!--<a href="blog_inner.html">Fusce sollicitudin felis vel</a>-->
							<!--<div class="date">14.11.2016</div>-->
						<!--</div>-->
						<!--<div class="news-footer">-->
							<!--<a href="blog_inner.html">Phasellus vitae dictum urna</a>-->
							<!--<div class="date">14.11.2016</div>-->
						<!--</div>-->
					<!--</div>-->
					<!--<div class="col-md-2">-->
						<!--<h6>Best Posts</h6>-->
						<!--<ul class="footer-menu">-->
							<!--<li><a href="about_us.html">About us</a></li>-->
							<!--<li><a href="">Sitemap</a></li>-->
							<!--<li><a href="contacts.html">Contacts</a></li>-->
							<!--<li><a href="blog.html">Blog</a></li>-->
							<!--<li><a href="gallery.html">Gallery</a></li>-->
						<!--</ul>-->
					<!--</div>-->
					<!--<div class="col-md-3">-->
						<!--<h6>Contacts</h6>-->
						<!--<address>Duis volutpat et magna quis congue. Nullam non velit porta, vulputate odio tempus, volutpat nibh. Mauris dictum dolor non interdum auctor</address>-->
						<!--<div class="footer-phone"><i class="fa fa-phone" aria-hidden="true"></i> +1 (123) 456 78 90</div>-->
					<!--</div>-->
				<!--</div>-->
				<!--<ul class="social">-->
					<!--<li><a href="#"><i class="fa fa-facebook" aria-hidden="true"></i></a></li>-->
					<!--<li><a href="#"><i class="fa fa-google-plus" aria-hidden="true"></i></a></li>-->
					<!--<li><a href="#"><i class="fa fa-twitter" aria-hidden="true"></i></a></li>-->
					<!--<li><a href="#"><i class="fa fa-youtube-play" aria-hidden="true"></i></a></li>-->
				<!--</ul>-->
			<!--</div>-->
		<!--</footer>-->
		<!-- footer -->
		<!-- scripts -->
		<script src="../../js/lib/jquery-1.10.1.min.js"></script>
		<script src="../../js/angular/jquery.blockUI.js"></script>
		<script src="../../js/lib/angular.min.js"></script>


		<script src="../../js/lib/jquery.js"></script>
		<script src="../../js/lib/bootstrap.min.js"></script>
		<script src="../../js/lib/lightbox.min.js"></script>
		<script src="../../js/lib/shuffle.js"></script>
		<script src="../../js/lib/swiper.min.js"></script>
		<script src="../../js/lib/waypoints.min.js"></script>
		<script src="../../js/script.js"></script>
		<script src="../js/lib/jquery-form.js"></script>

		<script src="../../js/addressManager.js"></script>

	<script  type="text/javascript">
        var app = angular.module("myApp",[]);

        app.controller("myCtrl",function($scope,$http,$timeout, $interval) {

            $scope.loaddata = function () {
//                alert("54");
                $scope.getPerson();
            }

            $scope.updateUser = function () {
                var datajson =  {"username":$scope.username,"userimg":$("#imgAddr").val()};
                console.log(datajson);
                $http({
                    method:'POST',
                    url:"../../person/updateUser",
                    data:datajson
                }).success( function (data){
//						console.log(data.info);
                    if (data.status == "s") {
                        alert("保存成功");
                        window.location.reload();
                    }
                }).error(function(data, status, headers, config) {});
            }

            $scope.getPerson=function () {

                $http({
                    method:'POST',
                    url:"../../person/getPersonInfo",
                    data: {}
                }).success( function (data){
//						console.log(data.info);
                    if (data.status == "s") {
//                        alert("留言成功！");
                        $scope.person =data.info;
                        $scope.username = data.info.userName;
                        $("#imgAddr").val(data.info.userImg)
                    }
                }).error(function(data, status, headers, config) {});

            }

        });

        jQuery(function () {
            $("._box").click(function () {
                $("#_f").click();
            });
        });


        function changepic(e){
//                console.log($("#_f")[0].files[0]);
//                 ($("#_f")[0].files[0]);

            //表单提交事件
//                $('#imageForm').submit();
            subimtBtn();

        }
        var pathName=window.document.location.pathname;
        //获取带"/"的项目名，如：/uimcardprj
        var projectName=pathName.substring(0,pathName.substr(1).indexOf('/')+1);
//        alert(projectName);
        function subimtBtn() {

            var form = $("#imageForm");
            $("#showimg").attr("src","../../img/tupianjiazaizhong.png");
            var options  = {
                type:'post',
                success:function(data){
                    console.log(data);

                    $("#showimg").attr("src","../../"+data.address);
                    $("#imgAddr").val(data.address);
//                    $scope.imgAddr = data.address;
//                    alert($("#imgAddr").val());
                },
                error:function(data){
                    console.log(data.responseText);
                    alert("图片处理失败，文件太大,支持10M以下");
                    $("#showimg").attr("src","../../img/toumingxuanze.png");
                    $("#imgAddr").val(null);
                }
            };
            form.ajaxSubmit(options);
//                 $("#imageForm").submit();
        }
	</script>
	</body>
</html>
